/********************************************************************************
 *      Copyright:  (C) 2025 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  get_temp.hpp
 *    Description:  This file
 *
 *        Version:  1.0.0(29/09/25)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "29/09/25 10:56:13"
 *                 
 ********************************************************************************/

#ifndef _GET_TEMP_H_
#define _GET_TEMP_H_

#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <iomanip>
#include <ctime>
#include <stdexcept>
#include <cstring>
#include <dirent.h>

namespace IotClient {

//传感器数据
class Ds18b20Sensor {
public:
    Ds18b20Sensor(); //构造函数：初始化时尝试查找传感器

    float getTemperature();

private:
    std::string chip_id;
    const std::string w1_path = "/sys/bus/w1/devices/";

    int findChipId();
};

class SystemInfo {
public:
    SystemInfo() = default;

    std::string getSystemTime();

    std::string getDevicedId();

private:
    const int DEFAULT_SN = 1; //设备ID
};

}

#endif
